package com.genexususa.eo.bing.test.set;

import com.genexususa.eo.bing.connection.AdGroupManager;
import com.genexususa.eo.bing.test.TestUtil;

public class ConsumeSetNegativeSitesToAdGroups {
    public static void main(String[] args) {
        TestUtil testUtil = new TestUtil();
        String adGroupNegativeSitesRequestsXML =    "<Bing_AdGroupNegativeSitesRequestCollection xmlns=\"L2TMediaDev\">\n" +
                                                        "\t<Bing_AdGroupNegativeSitesRequest xmlns=\"L2TMediaDev\">\n" +
                                                            "\t\t<GxCampaignId>416149485</GxCampaignId>\n" +
                                                            "\t\t<BingCampaignId>" + testUtil.campaignId1 + "</BingCampaignId>\n" +
                                                            "\t\t<AdGroupNegativeSitesCollection>\n" +
                                                                "\t\t\t<AdGroupNegativeSites>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup11 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeSiteCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite111.com</NegativeSite>\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite112.com</NegativeSite>\n" +
                                                                    "\t\t\t\t</NegativeSiteCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeSites>\n" +
                                                                "\t\t\t<AdGroupNegativeSites>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561565</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup12 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeSiteCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite121.com</NegativeSite>\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite122.com</NegativeSite>\n" +
                                                                    "\t\t\t\t</NegativeSiteCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeSites>\n" +
                                                            "\t\t</AdGroupNegativeSitesCollection>\n" +
                                                        "\t</Bing_AdGroupNegativeSitesRequest>\n" +
                                                        "\t<Bing_AdGroupNegativeSitesRequest xmlns=\"L2TMediaDev\">\n" +
                                                            "\t\t<GxCampaignId>416149486</GxCampaignId>\n" +
                                                            "\t\t<BingCampaignId>" + testUtil.campaignId2 + "</BingCampaignId>\n" +
                                                            "\t\t<AdGroupNegativeSitesCollection>\n" +
                                                                "\t\t\t<AdGroupNegativeSites>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561564</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup21 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeSiteCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite211.com</NegativeSite>\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite212.com</NegativeSite>\n" +
                                                                    "\t\t\t\t</NegativeSiteCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeSites>\n" +
                                                                "\t\t\t<AdGroupNegativeSites>\n" +
                                                                    "\t\t\t\t<GxAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">284894561565</GxAdGroupId>\n" +
                                                                    "\t\t\t\t<BingAdGroupId xmlns=\"https://adcenter.microsoft.com/v8\">" + testUtil.adGroup22 + "</BingAdGroupId>\n" +
                                                                    "\t\t\t\t<NegativeSiteCollection xmlns=\"https://adcenter.microsoft.com/v8\">\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite221.com</NegativeSite>\n" +
                                                                        "\t\t\t\t\t<NegativeSite>www.negativesite222.com</NegativeSite>\n" +
                                                                    "\t\t\t\t</NegativeSiteCollection>\n" +
                                                                "\t\t\t</AdGroupNegativeSites>\n" +
                                                            "\t\t</AdGroupNegativeSitesCollection>\n" +
                                                        "\t</Bing_AdGroupNegativeSitesRequest>\n" +
                                                    "</Bing_AdGroupNegativeSitesRequestCollection>\n";
        AdGroupManager resource = new AdGroupManager();
        System.out.println("Consuming SetNegativeSitesToAdGroups.....");
        String userName = testUtil.userName;
        String password = testUtil.password;
        String developerToken = testUtil.developerToken;
        long customerId = testUtil.customerId;
        long customerAccountId = testUtil.customerAccountId;
        String applicationId = testUtil.applicationId;
        String result = resource.setNegativeSitesToAdGroups(customerAccountId, adGroupNegativeSitesRequestsXML);
        System.out.println("Result:\n" + result);
    }
}
